<!doctype html>
<html>
<head>
    <meta charset="UTF-8" />
    <!--<link rel="shortcut icon" href="__ROOT__/favicon.ico">-->
    <title>{$page_title|default='小韦云链'}</title>
    <link href="__STATIC__/font-awesome/css/font-awesome.min.css?v={:SITE_VERSION}" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/ymyui/css/ymyui.css">
    <!-- <link rel="stylesheet" href="__STATIC__/bootstrap/css/bootstrap.css"> -->
    <link href="__STATIC__/base/css/base.css?v={:SITE_VERSION}" rel="stylesheet">
    <link href="__STATIC__/base/css/module.css?v={:SITE_VERSION}" rel="stylesheet">
    <link href="__STATIC__/base/css/bctos.css?v={:SITE_VERSION}" rel="stylesheet">
    <link rel="stylesheet" href="//at.alicdn.com/t/font_727459_zyp88ew3c6.css"></link>

    <link rel="stylesheet" type="text/css" href="__CSS__/common.css?v={:SITE_VERSION}" media="all">
    <link rel="stylesheet" type="text/css" href="__CSS__/style.css?v={:SITE_VERSION}" media="all">
    <link rel="stylesheet" type="text/css" href="__CSS__/store.css?v={:SITE_VERSION}" media="all">

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="__STATIC__/bootstrap/js/html5shiv.js?v={:SITE_VERSION}"></script>
    <![endif]-->
    <!--[if lt IE 9]>
    <script type="text/javascript" src="__STATIC__/jquery-1.10.2.min.js"></script>
    <![endif]-->
    <!--[if gte IE 9]><!-->
    <script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
    <!--<![endif]-->
    <!-- <script type="text/javascript" src="__STATIC__/bootstrap/js/bootstrap.min.js"></script> -->
    <script type="text/javascript" src="__JS__/jquery.mousewheel.js?v={:SITE_VERSION}"></script>
    <!-- 加载layui -->
    <link rel="stylesheet" type="text/css" href="__STATIC__/layui/css/layui.css?v={:SITE_VERSION}" media="all"></link>
    <script type="text/javascript" src="__STATIC__/layui/layui.js"></script>

    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <script src="__STATIC__/clipboard.min.js"></script>
    <script type="text/javascript" src="__STATIC__/base/js/dialog.js?v={:SITE_VERSION}"></script>

    <script type="text/javascript" src="__STATIC__/webuploader-0.1.5/webuploader.min.js"></script>

    <script type="text/javascript" src="__STATIC__/base/js/admin_common.js?v={:SITE_VERSION}"></script>
    <script type="text/javascript" src="__STATIC__/base/js/admin_image.js?v={:SITE_VERSION}"></script>
    <script type="text/javascript" src="__STATIC__/masonry/masonry.pkgd.min.js"></script>
    <script type="text/javascript" src="__STATIC__/jquery.dragsort-0.5.2.min.js"></script>
    <script src="https://cdn.bootcss.com/limonte-sweetalert2/7.21.1/sweetalert2.all.min.js"></script>

    <!-- 封装的jquery表单验证插件，依赖sweetalert2 -->
    <script type="text/javascript">
        var  IMG_PATH = "__STATIC__/base/images";
        var  STATIC = "__STATIC__";
        var  ROOT = "__ROOT__";
        var  UPLOAD_PICTURE = "{:U('home/File/upload_picture',array('session_id'=>session_id()))}";
        var  UPLOAD_FILE = "{:U('home/File/upload',array('session_id'=>session_id()))}";
        var  UPLOAD_DIALOG_URL = "{:U('home/File/upload_dialog',array('session_id'=>session_id()))}";
        var  SELECT_ICON_URL = "{:U('home/File/layui_icon')}";
        var COPY_PAGE_URL = "{:U('home/index/copy')}";
        layui.use(['layer','form'], function(){
            var layer = layui.layer;
            var form = layui.form;
            if(typeof layui_funs === "function"){
                layui_funs(form)
            }
        });
    </script>

    {block name="style"}{/block}
</head>
<body style="padding:0; width:100%; height:100%">
    
    <!-- 边栏 -->
    

    <!-- 内容区 -->
    <div id="main-content">
        <div id="top-alert" class="fixed alert alert-error" style="display: none;">
            <button class="close fixed" style="margin-top: 4px;">&times;</button>
            <div class="alert-content">这是内容</div>
        </div>
        <div id="main" class="main">
        	 
            {block name="nav"}
            <!-- nav -->
            {notempty name="_show_nav"}
            <div class="breadcrumb">
                <span>您的位置:</span>
                <assign name="i" value="1" />
                {foreach name="_nav" item="v" key="k"}
                    {if condition="$i eq count($_nav)"}
                    <span>{$v}</span>
                    {else/}
                    <span><a href="{$k}">{$v}</a>&gt;</span>
                    {/if}
                    <assign name="i" value="$i+1" />
                {/foreach}
            </div>
            {/notempty}
            <!-- nav -->
            {/block}

            {block name="body"} {/block}
        </div>
    </div>
    <!-- /内容区 -->
    <script type="text/javascript" src="__STATIC__/base/js/admin_common.js?v={:SITE_VERSION}"></script>
    <script type="text/javascript">
        +function(){
            var $window = $(window), $subnav = $("#subnav"), url;
            $window.resize(function(){
                $("#main").css("min-height", $window.height() - 130);
            }).resize();

            /* 左边菜单高亮 */
            url = window.location.pathname + window.location.search;
            url = url.replace(/(\/(p)\/\d+)|(&p=\d+)|(\/(id)\/\d+)|(&id=\d+)|(\/(group)\/\d+)|(&group=\d+)/, "");
            $subnav.find("a[href$='" + url + "']").parent().addClass("current");
			
            /* 左边菜单显示收起 */
            $("#subnav").on("click", "h3", function(){
                var $this = $(this);
                $this.find(".icon").toggleClass("icon-fold");
                $this.next().slideToggle("fast").siblings(".side-sub-menu:visible").
                      prev("h3").find("i").addClass("icon-fold").end().end().hide();
            });

            $("#subnav h3 a").click(function(e){e.stopPropagation()});

            /* 头部管理员菜单 */
            $(".user-bar").mouseenter(function(){
                var userMenu = $(this).children(".user-menu ");
                userMenu.removeClass("hidden");
                clearTimeout(userMenu.data("timeout"));
            }).mouseleave(function(){
                var userMenu = $(this).children(".user-menu");
                userMenu.data("timeout") && clearTimeout(userMenu.data("timeout"));
                userMenu.data("timeout", setTimeout(function(){userMenu.addClass("hidden")}, 100));
            });

	        /* 表单获取焦点变色 */
	        $("form").on("focus", "input", function(){
		        $(this).addClass('focus');
	        }).on("blur","input",function(){
				        $(this).removeClass('focus');
			        });
		    $("form").on("focus", "textarea", function(){
			    $(this).closest('label').addClass('focus');
		    }).on("blur","textarea",function(){
			    $(this).closest('label').removeClass('focus');
		    });

            // 导航栏超出窗口高度后的模拟滚动条
            var sHeight = $(".sidebar").height();
            var subHeight  = $(".subnav").height();
            var diff = subHeight - sHeight; //250
            var sub = $(".subnav");
            if(diff > 0){
                $(window).mousewheel(function(event, delta){
                    if(delta>0){
                        if(parseInt(sub.css('marginTop'))>-10){
                            sub.css('marginTop','0px');
                        }else{
                            sub.css('marginTop','+='+10);
                        }
                    }else{
                        if(parseInt(sub.css('marginTop'))<'-'+(diff-10)){
                            sub.css('marginTop','-'+(diff-10));
                        }else{
                            sub.css('marginTop','-='+10);
                        }
                    }
                });
            }
        }();
    </script>
    {block name="script"}{/block}
</body>
</html>
